if (monitor !== Main.layoutManager.primaryIndex)
return;
- if (this._dragFocus) {
- this._dragFocus.cancelActions();
- this._dragFocus = null;
- }
-
const adjustment = this._adjustment;
adjustment.remove_transition('value');
};
DND.addDragMonitor(this._dragMonitor);
this._appGridLayout.showPageIndicators();
- this._dragFocus = null;
- this._swipeTracker.enabled = false;
}
_onDragMotion(dragEvent) {
this._resetDragPageSwitch();
this._appGridLayout.hidePageIndicators();
- this._swipeTracker.enabled = true;
}
_onDragCancelled() {
// will move all items to their original positions
this._redisplay();
this._appGridLayout.hidePageIndicators();
- this._swipeTracker.enabled = true;
}
_canAccept(source) {
this._appGridLayout.goToPage(pageNumber, animate);
this._grid.goToPage(pageNumber, animate);
}
-
- updateDragFocus(dragFocus) {
- this._dragFocus = dragFocus;
- }
});
const PageManager = GObject.registerClass({
global.settings.is_writable('app-picker-layout');
this._placeholder = new AppIcon(app, {isDraggable});
- this._placeholder.connect('notify::pressed', icon => {
- if (icon.pressed)
- this.updateDragFocus(icon);
- });
this._placeholder.scaleAndFade();
this._redisplay();
}
this._redisplay();
this._savePages();
});
- icon.connect('notify::pressed', () => {
- if (icon.pressed)
- this.updateDragFocus(icon);
- });
}
// Don't try to display empty folders
let app = appSys.lookup_app(appId);
icon = new AppIcon(app, {isDraggable});
- icon.connect('notify::pressed', () => {
- if (icon.pressed)
- this.updateDragFocus(icon);
- });
}
appIcons.push(icon);
return true;
}
- cancelActions() {
- if (this._draggable)
- this._draggable.fakeRelease();
- this.fake_release();
- }
-
get id() {
return this._id;
}
}
}
- _onDragBegin() {
- if (this._menu)
- this._menu.close(true);
- super._onDragBegin();
- }
-
_createIcon(iconSize) {
return this.app.create_icon_texture(iconSize);
}
popupMenu() {
this.setForcedHighlight(true);
- this.fake_release();
if (!this._menu) {
this._menu = new AppMenu(this, this._popupMenuSide, {
return view?.createFolder(apps);
}
-
- cancelActions() {
- if (this._menu)
- this._menu.close(true);
- super.cancelActions();
- }
});
const SystemActionIcon = GObject.registerClass(
this._grabbedEventSequence = null;
}
- /**
- * Fake a release event.
- * Must be called if you want to intercept release events on draggable
- * actors for other purposes (for example if you're using
- * PopupMenu.ignoreRelease())
- */
- fakeRelease() {
- this._dndGesture.set_state(Clutter.GestureState.CANCELLED);
- }
-
_gestureRecognized() {
const pointBeginEvent = this._dndGesture.get_point_begin_event();
[this._dragStartX, this._dragStartY] = pointBeginEvent.get_coords();